/**
 * 
 */
package fr.lelouet.ga.examples.multOf11;

import fr.lelouet.ga.Generation;
import fr.lelouet.ga.Generator;

import java.util.Random;

/**
 * @author guigolum
 */
public class Generator1To100 implements Generator<Integer> {

    protected int nbelems;

    public Generator1To100(final int nbelems) {
        this.nbelems = nbelems;
    }

    @Override
    public Generation<Integer> generate() {
        final Generation<Integer> ret = new Generation<Integer>();

        final Random ran = new Random();
        for (int i = 0; i < this.nbelems; i++) {
            ret.add((int) (ran.nextFloat() * 100));
        }

        return ret;
    }

}
